#!/usr/bin/env python
#/home/admin/cai/logs/cronolog/2013/04
"""
output:
[page:0][ip:1][status:2]
"""
import sys
import time
import extractor
from urlparse import urlparse
  
def main():
    begin = time.time()
    parse = extractor.parse
    
    for line in sys.stdin:
        try:  
            v = parse(line)
            url = urlparse(v.url)
            print('%s::%s::%d'%(url[2], v.ip, v.status))
        except Exception,ex:
            print >> sys.stderr, ex
            continue
    end = time.time()
    print >> sys.stderr, (end - begin)
    
if __name__ == "__main__":
    main()
